package com.gm.controller.remindtask;

import com.gm.common.Pager;
import com.gm.service.user.CardOperService;
import com.gm.service.user.RemindPayTaskService;
import com.gm.tools.Common;
import com.gm.tools.DateUtils;
import com.gm.controller.dto.CardOperDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * Created by Administrator on 2017/7/3.
 */

@Controller
@RequestMapping("task")
public class RemindPayTaskController {

    @Autowired
    private RemindPayTaskService remindPayTaskService;

    @Autowired
    private CardOperService cardOperService;

    @RequestMapping("taskList.web")
    public ModelAndView cardList(Pager pager){
        ModelAndView view= new ModelAndView();
        List<CardOperDTO> cardOperPlanList = cardOperService.getCardOperListByOperTime(DateUtils.getCurrentUnixTime());
        for(int i=0; i < cardOperPlanList.size(); i++){
            cardOperPlanList.get(i).setCdNum(Common.getBankAccount(cardOperPlanList.get(i).getCdNum()));
        }

        view.addObject("cardOperPlanList", cardOperPlanList);

        view.setViewName("/remindTask/remindTask.jsp");
        return view;
    }
}
